package br.com.poc.pitagorasnumero.view.activity;

import br.com.poc.pitagorasnumero.R;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import roboguice.activity.RoboFragmentActivity;

/**
 * @author irlan.gomes
 * 
 */
public class SplashScreenActivity extends RoboFragmentActivity {

	private static final int TIME = 1000;// 1 seconds

	/*
	 * (non-Javadoc)
	 * 
	 * @see roboguice.activity.RoboFragmentActivity#onCreate(android.os.Bundle)
	 */
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.splashcreen);

		new Handler().postDelayed(new Runnable() {

			@Override
			public void run() {
				Intent intent = new Intent(SplashScreenActivity.this,
						MainMenuActivity.class);
				startActivity(intent);

				SplashScreenActivity.this.finish();

				overridePendingTransition(R.animator.splash_fade_in,
						R.animator.splash_fade_out);

			}
		}, TIME);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see android.support.v4.app.FragmentActivity#onBackPressed()
	 */
	@Override
	public void onBackPressed() {
		this.finish();
		super.onBackPressed();
	}

}
